package com.yunxi.module.system.mapper.oauth2;

import com.yunxi.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.module.system.model.oauth2.OAuth2RefreshTokenDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * OAuth2 刷新令牌 mapper
 * </p>
 *
 * @author lidy
 * @since 2024-05-08
 */
@Mapper
public interface OAuth2RefreshTokenMapper extends BaseMapperX<OAuth2RefreshTokenDO> {

    /**
     * 获得刷新访问令牌信息
     *
     * @param refreshToken 刷新令牌
     * @return 刷新访问令牌信息
     */
    default OAuth2RefreshTokenDO selectByRefreshToken(String refreshToken) {
        return selectOne(OAuth2RefreshTokenDO::getRefreshToken, refreshToken);
    }
}
